import { getCookie, setCookie } from '../util/token';

const car = {
  state: {
    cars: [],
    cartype: [],
    company: {},
    carinfo: {},
    staticurl: ""
  },
  mutations: {
    GET_CARS: (state, payload) => {
      state.cars = payload.cars;
      state.staticurl = payload.url;
      // setCookie('cars', payload.cars);
      // setCookie('staticurl', payload.url);
    },
    GET_CAR_TYPE: (state, payload) => {
      state.cartype = payload;
      // setCookie('cartype', payload);
    },
    GET_COMPANY_INFO: (state, payload) => {
      state.company = payload;
      // setCookie('company', payload);
    },
    GET_CAR_INFO: (state, payload) => {
      state.carinfo = payload;
      // setCookie('carinfo', payload);
    },
  },
};
export default car;
